#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "binary_tree.h"

int main() {
    binary_tree_node_t *binary_tree = new_binary_tree_node(12);

    binary_tree_insert(&binary_tree, 10);
    binary_tree_insert(&binary_tree, 13);
    binary_tree_insert(&binary_tree, 20);
    binary_tree_insert(&binary_tree, 15);
    binary_tree_insert(&binary_tree, 6);
    binary_tree_insert(&binary_tree, 8);
    binary_tree_insert(&binary_tree, 10);
    binary_tree_insert(&binary_tree, 14);

    postorder_traversal_binary_tree(binary_tree);
    printf("\n");
    binary_tree_delete(&binary_tree, 6);
    postorder_traversal_binary_tree(binary_tree);
    printf("\n");
    binary_tree_delete(&binary_tree, 13);
    postorder_traversal_binary_tree(binary_tree);
    printf("\n");
    printf("前序遍历\n");
    preorder_traversal_binary_tree(binary_tree);
    printf("\n");
    printf("中序遍历\n");
    middle_order_traversal_binary_tree(binary_tree);
    printf("\n");
    printf("后序遍历\n");
    postorder_traversal_binary_tree(binary_tree);
    printf("\n");
    binary_tree_destroy(binary_tree);
    binary_tree = NULL;

    return 0;
}
